<template>
    <div>
       <MyHeader headName="我的收藏" @tojemp="$router.back()"></MyHeader>
       <NewsItem :postData="item" v-for="item in collentionList" :key="item.id"></NewsItem>
    </div>
</template>

<script>
import MyHeader from '../../components/MyHeader'
import NewsItem from '../../components/NewsItem'
export default {
    data(){
        return{
            collentionList:[]
        }
    },
    components:{
        MyHeader,
        NewsItem
    },
    methods:{
        getCollentionList(){
            this.$axios({
                url:'/user_star',
                method:'get'
            }).then(res=>{
                console.log(res);
                this.collentionList = res.data.data;
            })
        }
    },
    mounted(){
        // for(let i=1;i<=1000;i++){
        //     this.$axios({
        //         url:'/post_star/'+i,
        //         method:'get'
        //     })
        // }
        this.getCollentionList();
    }
}
</script>

<style lang="less" scoped>
/deep/ .header{
    padding:5.556vw 0;
}
</style>